import request from '@/utils/request'
//题库相关
export function addQuestion(data) {
  return request({
    url: '/admin/user/question/addQuestion',
    method: 'post',
    data
  })
}

export function getQuestionList(params) {
  return request({
    url: '/admin/user/question/questionList',
    method: 'get',
    params
  })
}

export function detailQuestion(params) {
  return request({
    url: '/admin/user/question/answerInfo',
    method: 'get',
    params
  })
}

export function delQuestion(data) {
  return request({
    url: '/admin/user/question/delQuestion',
    method: 'post',
    data
  })
}
//活动轮播图 和 年会项目 相关 (type 1是轮播   2是年会项目)
export function addSiwper(data) {
  return request({
    url: '/admin/user/slide/addRecord',
    method: 'post',
    data
  })
}

export function getRecordList(params) {
  return request({
    url: '/admin/user/slide/recordList',
    method: 'get',
    params
  })
}

export function sortSlide(data) {
  return request({
    url: '/admin/user/slide/updateSort',
    method: 'post',
    data
  })
}

export function delSiwper(data) {
  return request({
    url: '/admin/user/slide/delRecord',
    method: 'post',
    data
  })
}

export function updateSiwper(data) {
  return request({
    url: '/admin/user/slide/updateRecord',
    method: 'post',
    data
  })
}

export function detailSiwper(params) {
  return request({
    url: '/admin/user/slide/recordInfo',
    method: 'get',
    params
  })
}
//弹窗活动设置相关
export function addActitvty(data) {
  return request({
    url: '/admin/user/activity/addActivity',
    method: 'post',
    data
  })
}

export function getActitvtyList(params) {
  return request({
    url: '/admin/user/activity/activityList',
    method: 'get',
    params
  })
}

export function delActitvty(data) {
  return request({
    url: '/admin/user/activity/delActivity',
    method: 'post',
    data
  })
}

export function getActivityPushInfo(params) {
  return request({
    url: '/admin/user/activity/getActivityPushInfo',
    method: 'get',
    params
  })
}

export function changeActivityPush(data) {
  return request({
    url: '/admin/user/activity/changeActivityPush',
    method: 'post',
    data
  })
}
export function getActivityInfo(params) {
  return request({
    url: '/admin/user/activity/activityInfo',
    method: 'get',
    params
  })
}
export function updateActivity(data) {
  return request({
    url: '/admin/user/activity/updateActivity',
    method: 'post',
    data
  })
}


export function getHomeDescription () {
  return request({
    url : '/admin/homeInfo',
    method : 'get',
  });
}


export function updateHomeDescription(data) {
  return request({
    url : '/admin/homeInfo',
    method: 'post',
    data
  });
}

//上传富文本图片方法
export function uploadImage(data) {
  return request({
    url: '/api/uploadImage',
    method: 'post',
    data
  });
}

//获取约车说明
export function getReserve() {
  return request({
    url: '/admin/reserveInfo',
    method: 'get'
  });
}

//更新约车说明
export function updateReserve(data) {
  return request({
    url: '/admin/reserveInfo',
    method: 'post',
    data
  });
}

//获取推广相关信息
export function getPromoteInfo() {
  return request({
    url: '/admin/promoteInfo',
    method: 'get',
  });
}

//更新推广相关信息
export function updatePromoteInfo(data) {
  return request({
    url: '/admin/promoteInfo',
    method: 'post',
    data
  });
}
